// 2013-7-28下午11:51:44  net.betou.trade.entity.main.base.BaseCategory.java

package net.betou.trade.entity.main.base;

import java.io.Serializable;

import net.betou.trade.entity.main.NoticeType;

/**
 * 公告分类
 * @author 叶装装
 */
public abstract class BaseNoticeType implements Serializable{
	
	private static final long serialVersionUID = 1L;

	private Integer id;
	private String name;
	private String description; // 描述
	private String identity;
	
	public BaseNoticeType( ){
	}

	public Integer getId( ) {
		return id;
	}

	public void setId( Integer id ) {
		this.id = id;
		this.hashCode = Integer.MIN_VALUE;
	}

	public String getName( ) {
		return name;
	}

	public void setName( String name ) {
		this.name = name;
	}

	public String getIdentity( ) {
		return identity;
	}

	public void setIdentity( String identity ) {
		this.identity = identity;
	}

	public String getDescription( ) {
		return description;
	}

	public void setDescription( String description ) {
		this.description = description;
	} 
	
	private int hashCode = Integer.MIN_VALUE;
	
	public boolean equals( Object obj ) {
		if( null == obj )
			return false;
		if( !( obj instanceof NoticeType ) )
			return false;
		else{
			NoticeType noticeType = ( NoticeType ) obj;
			if( null == this.getId( ) || null == noticeType.getId( ) )
				return false;
			else
				return( this.getId( ).equals( noticeType.getId( ) ) );
		}
	}

	public int hashCode( ) {
		if( Integer.MIN_VALUE == this.hashCode ){
			if( null == this.getId( ) )
				return super.hashCode( );
			else{
				String hashStr = this.getClass( ).getName( ) + ":" + this.getId( ).hashCode( );
				this.hashCode = hashStr.hashCode( );
			}
		}
		return this.hashCode;
	}
	
	
	
}
